import Vue from "vue";
import VueRouter from "vue-router";

// 引入组件
import Home from "./components/Home.vue";
import About from "./components/About.vue";
import Contact from "./components/Contact.vue";

// 要告诉 vue 使用 vueRouter
Vue.use(VueRouter);

const routes = [
  {
    path:"/home",
    component: Home
  },
  {
    path: "/about",
    component: About
  },
  {
    path: "/contact",
    component: Contact
  },
  {
    path: '/',
    redirect: '/home'
  }
]

var router =  new VueRouter({
  routes
})
export default router;